package com.sf.asp.controller;


import com.sf.asp.entity.dto.RolePermissionDTO;
import com.sf.asp.entity.vo.ResponseInfo;
import com.sf.asp.service.RolePermissionService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jins
 * @since 2021-11-24
 */
@Controller
@RequestMapping("/role-permission")
public class RolePermissionController {

    private final RolePermissionService rolePermissionService;

    public RolePermissionController(RolePermissionService rolePermissionService){
        this.rolePermissionService = rolePermissionService;
    }

    @PostMapping("/save")
    @ResponseBody
    public ResponseInfo saveRolePermission(@RequestBody RolePermissionDTO rolePermission){
        rolePermissionService.save(rolePermission);
        return ResponseInfo.ok();
    }

}
